Decouple DisplayServer from as much of the codebase as possible#116976
Decouple DisplayServer from as much of the codebase as possible#116976akien-mga wants to merge 4 commits intogodotengine:masterfrom
Conversation
60339d2 to
7556774
Compare
faae013 to
bd4d15f
Compare
|
I moved the remaining enums to Things are a bit messy around MouseMode (duplicated in To decouple Finally, after looking so much at With these changes, I'm down to an incremental recompilation time after changing |
This will allow decoupling `display_server.h` from a number of headers in the codebase which only require those enums and not all the DisplayServer API.
Notably decouples it from: - AccessibilityServer - DisplayServer - Viewport - Window
|
I kept the commits separate for ease of review, as this kind of PR ends up affecting a lot of the codebase. Once approved, I will force-push a squashed version similar to this: https://github.com/akien-mga/godot/commits/displayserver-split-types-squashed/
|
bruvzg
left a comment
There was a problem hiding this comment.
Code looks good, tested on macOS, iOS, and Windows.
visionOS fails to build due to vsnprintf, this is likely casued by some of previous header changes, and not this PR:
diff --git a/drivers/apple/os_log_logger.cpp b/drivers/apple/os_log_logger.cpp
index 50b695dfa9..86ddfa28e6 100644
--- a/drivers/apple/os_log_logger.cpp
+++ b/drivers/apple/os_log_logger.cpp
@@ -33,7 +33,8 @@
#include "core/object/script_backtrace.h"
#include "core/string/print_string.h"
-#include <cstdlib> // For malloc/free
+#include <cstdlib> // For malloc/free.
+#include <cstdio> // For vsnprintf.
OsLogLogger::OsLogLogger(const char *p_subsystem) {
const char *subsystem = p_subsystem;bd4d15f to
76f4588
Compare
|
I pushed the squashed history so this should be ready to merge. The original history with all commits is here: https://github.com/akien-mga/godot/commits/displayserver-split-types-history/ I'll make a separate PR to fixup the visionOS build. |
RSEnamespace #116454I kept commits separate from review, but the "Move" commits can be squashed before merge, and the resulting commit can be added to the
.git-blame-ignore-revs.I haven't moved all enums yet, only the ones necessary to decouple DisplayServer from the most critical headers.
For consistency with RenderingServer and AccessibilityServer, we probably want to move all enums to DisplayServerEnums anyway. That will also allow removing a few extra includes.
With these changes, an incremental rebuild after changing
display_server.hon my machine changes like this:00:00:47.3600:00:42.10The gains are probably mainly from removing
display_server.hfromviewport.handrendering_server.h(control.hwas decoupled by #116839, my "before" number is from before this PR as I initially also decoupled fromcontrol.hhere).